import createAPIComponent from 'vue-create-api'
import { Component, VueConstructor } from 'vue'

export default function createAPI (Vue: VueConstructor, Component: Component, events?: string[], single?: boolean) {
  Vue.use(createAPIComponent, { componentPrefix: 'cube-', apiPrefix: '$create-' })
  const api = Vue.createAPI(Component, events, single)
  return api
}
